package com.solvetask.api;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.solvetask.util.MD5Util;

/**
 * API总线，外部调用时此Servlet为入口，根据业务编号进行业务转发
 */
@WebServlet("/Api/Request")
public class ApiBus extends HttpServlet {
	private static final long serialVersionUID = 1L;
	
	/*
	 * 业务编号
	 */
	private String protocolNumber;
	/*
	 * 平台来源
	 */
    private String platform;
    /**
     * @see HttpServlet#HttpServlet()
     */
    public ApiBus() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	    response.setCharacterEncoding("utf-8");      
	    response.setContentType("text/html; charset=utf-8");  
		PrintWriter out=response.getWriter();
		out.println(MD5Util.MD5("访问成功！"));
		out.println();
	}

	/**
	 * 根据业务编号进行转发处理
	 */
	private void forwarding(){
		
	}
	
}
